load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:thrift_library.bzl", "thrift_library")

oncall("scm_client_infra")

thrift_library(
    name = "serialization",
    languages = [
        "cpp2",
    ],
    no_plugin_deps = [
        "//thrift/annotation:cpp",
        "//thrift/annotation:hack",
        "//thrift/annotation:java",
        "//thrift/annotation:python",
    ],
    py_base_module = "facebook.eden",
    thrift_srcs = {
        "takeover.thrift": [],
    },
)

cpp_library(
    name = "takeover",
    srcs = glob(["*.cpp"]),
    headers = glob(["*.h"]),
    deps = [
        "fbsource//third-party/fmt:fmt",
        "//eden/common/utils:bug",
        "//eden/common/utils:throw",
        "//eden/fs/utils:event_base_state",
        "//folly:likely",
        "//folly:network_address",
        "//folly:range",
        "//folly/io/async:async_base",
        "//folly/logging:logging",
        "//thrift/lib/cpp2/protocol:protocol",
    ],
    exported_deps = [
        ":serialization-cpp2-types",
        "//eden/common/utils:fault_injector",
        "//eden/common/utils:io",
        "//eden/common/utils:path",
        "//eden/fs/config:config",
        "//eden/fs/utils:fs_channel_types",
        "//folly:file",
        "//folly/futures:core",
        "//folly/io:iobuf",
        "//folly/io/async:server_socket",
    ],
)
